#!/usr/bin/perl -w # for syntax
use gri_secmgr qw(get_user_name);
# CSS-V1

sub mm_admin_docrepos_groups_options {
my ($portal,$repname,$repnum)=@_;

	my $user_name=get_user_name();
	my ($docrepos_admin,$err)=$::GRI_FRONTEND->does_user_have_role($user_name,"docrepos_admin");

	#################################################################
	# If the user is not in the "user_admin" then we don't create	#
	# any links...							#
	#################################################################
	if($docrepos_admin==0) {
		my $s="
    <tr class=gri_row>
      <td class=gri_cell-disabled colspan=2>&nbsp; &nbsp; Add New Document Repository Group</td>
    </tr>
    <tr class=gri_row>
      <td class=gri_cell-disabled colspan=2>&nbsp; &nbsp; Modify Existing Document Repository Group</td>
    </tr>
    <tr class=gri_row>
      <td class=gri_cell-disabled colspan=2>&nbsp; &nbsp; Delete Exising Document Repository Group</td>
    </tr>";
		if($::GRI_FRONTEND->using_groups()==1) {
			$s.="    <tr class=gri_row>
      <td class=gri_cell-disabled colspan=2>&nbsp; &nbsp; Add/Delete User Groups for Exising Document Repository Group</td>
    </tr>";
		}
		return $s;
	}
	#################################################################
	# We now need to generate links to the docrepos_sections	#
	# admin pages ...						#
	#################################################################
	my $s="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Add New Document Repository Group","form_docrepos_admin_add_group","");
	$s.="
      </td>
    </tr>";
	my $a=string_to_hex("modify");
	$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Modify Existing Document Repository Group","form_docrepos_admin_modify_group","action=$a");
	$s.="
      </td>
    </tr>";
	$a=string_to_hex("delete");
	$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Delete Existing Document Repository Group","form_docrepos_admin_modify_group","action=$a");
	$s.="
      </td>
    </tr>";
	if($::GRI_FRONTEND->using_groups()==1) {
		my $lnk=link_to_str("stdlink","Add/Delete User Groups for Exising Document Repository Group","form_docrepos_admin_modify_group_groups","");
		$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;$lnk</td>
    </tr>";
	}
	return $s;
}

1;
